<template>
  <!--全局悬浮按钮-->
  <div class="fixed-btn-box" v-dragable>
    <div class="relation-box">
      <span class="data_num" style="display:none;"><mark></mark></span>
      <a class="feed-back fixed-btn" @click="popFeedBack" role="button">
        <div class="a-box">
          <span>意见反馈</span>
          <img src="/static/resources/img/icon-feed-logo.png">
        </div>
      </a>
      <a class="knowledge-base fixed-btn" @clik="toKnowledge" role="button" target="_Blank" title="问题上报">
        <div class="a-box">
          <span>问题上报</span>
          <img src="/static/resources/img/icon-knowledge-logo.png">
        </div>
      </a>
      <a class="go-top fixed-btn" @click="smoothscroll" role="button" title="回到顶部">
        <div class="a-box">
          <span>回到顶部</span>
          <img src="/static/resources/img/icon-go-to-logo.png">
        </div>
      </a>
      <div class="fixed-1"></div>
      <div class="fixed-2"></div>
    </div>
  </div>
</template>

<script>
    export default {
      name: "fixed-button",
      methods:{
        popFeedBack() {
          let url = '../feedback.html';
          let name = 'add';
          let iWidth = 1200;
          let iHeight = 670;
          let iTop = (window.screen.availHeight - 30 - iHeight) / 2;
          let iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
          window.open(url, name, 'height=' + iHeight + ', innerHeight=' + iHeight + ', width=' + iWidth + ', innerWidth=' + iWidth + ', top=' + iTop + ', left=' + iLeft + ', status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=0, titlebar=no');
        },
        toKnowledge() {
          let newTab=window.open('about:blank');
          // dataType: "json",
          //   contentType: "application/json",
          this.axios.post(MESSAGE_SERVICE_URL + "treeMessageController/queryKnowleg",()=>{
            newTab.location.href=ICD_ADDERSS+r.url;
          }).catch(()=>{
            console.log("fail");
          });
        },
        smoothscroll(){
          let currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
          if (currentScroll > 0) {
            window.requestAnimationFrame(this.smoothscroll);
            window.scrollTo (0,currentScroll - (currentScroll/5));
          }
        }
      }
    }
</script>

<style scoped>

</style>
